// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file collision_report.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "collision_report.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

collision_report::collision_report()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_src_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_src_ = 0;
    // m_id_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_id_ = 0;
    // m_action_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_action_ = 0;
    // m_threat_level_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_threat_level_ = 0;
    // m_time_to_minimum_delta_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5b87ed94
    m_time_to_minimum_delta_ = 0.0;
    // m_altitude_minimum_delta_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e0e048a
    m_altitude_minimum_delta_ = 0.0;
    // m_horizontal_minimum_delta_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bc79255
    m_horizontal_minimum_delta_ = 0.0;

}

collision_report::~collision_report()
{








}

collision_report::collision_report(const collision_report &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_src_ = x.m_src_;
    m_id_ = x.m_id_;
    m_action_ = x.m_action_;
    m_threat_level_ = x.m_threat_level_;
    m_time_to_minimum_delta_ = x.m_time_to_minimum_delta_;
    m_altitude_minimum_delta_ = x.m_altitude_minimum_delta_;
    m_horizontal_minimum_delta_ = x.m_horizontal_minimum_delta_;
}

collision_report::collision_report(collision_report &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_src_ = x.m_src_;
    m_id_ = x.m_id_;
    m_action_ = x.m_action_;
    m_threat_level_ = x.m_threat_level_;
    m_time_to_minimum_delta_ = x.m_time_to_minimum_delta_;
    m_altitude_minimum_delta_ = x.m_altitude_minimum_delta_;
    m_horizontal_minimum_delta_ = x.m_horizontal_minimum_delta_;
}

collision_report& collision_report::operator=(const collision_report &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_src_ = x.m_src_;
    m_id_ = x.m_id_;
    m_action_ = x.m_action_;
    m_threat_level_ = x.m_threat_level_;
    m_time_to_minimum_delta_ = x.m_time_to_minimum_delta_;
    m_altitude_minimum_delta_ = x.m_altitude_minimum_delta_;
    m_horizontal_minimum_delta_ = x.m_horizontal_minimum_delta_;

    return *this;
}

collision_report& collision_report::operator=(collision_report &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_src_ = x.m_src_;
    m_id_ = x.m_id_;
    m_action_ = x.m_action_;
    m_threat_level_ = x.m_threat_level_;
    m_time_to_minimum_delta_ = x.m_time_to_minimum_delta_;
    m_altitude_minimum_delta_ = x.m_altitude_minimum_delta_;
    m_horizontal_minimum_delta_ = x.m_horizontal_minimum_delta_;

    return *this;
}

size_t collision_report::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

size_t collision_report::getCdrSerializedSize(const collision_report& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

void collision_report::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_src_;
    scdr << m_id_;
    scdr << m_action_;
    scdr << m_threat_level_;
    scdr << m_time_to_minimum_delta_;
    scdr << m_altitude_minimum_delta_;
    scdr << m_horizontal_minimum_delta_;
}

void collision_report::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_src_;
    dcdr >> m_id_;
    dcdr >> m_action_;
    dcdr >> m_threat_level_;
    dcdr >> m_time_to_minimum_delta_;
    dcdr >> m_altitude_minimum_delta_;
    dcdr >> m_horizontal_minimum_delta_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void collision_report::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t collision_report::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& collision_report::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member src_
 * @param _src_ New value for member src_
 */
void collision_report::src_(uint8_t _src_)
{
m_src_ = _src_;
}

/*!
 * @brief This function returns the value of member src_
 * @return Value of member src_
 */
uint8_t collision_report::src_() const
{
    return m_src_;
}

/*!
 * @brief This function returns a reference to member src_
 * @return Reference to member src_
 */
uint8_t& collision_report::src_()
{
    return m_src_;
}

/*!
 * @brief This function sets a value in member id_
 * @param _id_ New value for member id_
 */
void collision_report::id_(uint32_t _id_)
{
m_id_ = _id_;
}

/*!
 * @brief This function returns the value of member id_
 * @return Value of member id_
 */
uint32_t collision_report::id_() const
{
    return m_id_;
}

/*!
 * @brief This function returns a reference to member id_
 * @return Reference to member id_
 */
uint32_t& collision_report::id_()
{
    return m_id_;
}

/*!
 * @brief This function sets a value in member action_
 * @param _action_ New value for member action_
 */
void collision_report::action_(uint8_t _action_)
{
m_action_ = _action_;
}

/*!
 * @brief This function returns the value of member action_
 * @return Value of member action_
 */
uint8_t collision_report::action_() const
{
    return m_action_;
}

/*!
 * @brief This function returns a reference to member action_
 * @return Reference to member action_
 */
uint8_t& collision_report::action_()
{
    return m_action_;
}

/*!
 * @brief This function sets a value in member threat_level_
 * @param _threat_level_ New value for member threat_level_
 */
void collision_report::threat_level_(uint8_t _threat_level_)
{
m_threat_level_ = _threat_level_;
}

/*!
 * @brief This function returns the value of member threat_level_
 * @return Value of member threat_level_
 */
uint8_t collision_report::threat_level_() const
{
    return m_threat_level_;
}

/*!
 * @brief This function returns a reference to member threat_level_
 * @return Reference to member threat_level_
 */
uint8_t& collision_report::threat_level_()
{
    return m_threat_level_;
}

/*!
 * @brief This function sets a value in member time_to_minimum_delta_
 * @param _time_to_minimum_delta_ New value for member time_to_minimum_delta_
 */
void collision_report::time_to_minimum_delta_(float _time_to_minimum_delta_)
{
m_time_to_minimum_delta_ = _time_to_minimum_delta_;
}

/*!
 * @brief This function returns the value of member time_to_minimum_delta_
 * @return Value of member time_to_minimum_delta_
 */
float collision_report::time_to_minimum_delta_() const
{
    return m_time_to_minimum_delta_;
}

/*!
 * @brief This function returns a reference to member time_to_minimum_delta_
 * @return Reference to member time_to_minimum_delta_
 */
float& collision_report::time_to_minimum_delta_()
{
    return m_time_to_minimum_delta_;
}

/*!
 * @brief This function sets a value in member altitude_minimum_delta_
 * @param _altitude_minimum_delta_ New value for member altitude_minimum_delta_
 */
void collision_report::altitude_minimum_delta_(float _altitude_minimum_delta_)
{
m_altitude_minimum_delta_ = _altitude_minimum_delta_;
}

/*!
 * @brief This function returns the value of member altitude_minimum_delta_
 * @return Value of member altitude_minimum_delta_
 */
float collision_report::altitude_minimum_delta_() const
{
    return m_altitude_minimum_delta_;
}

/*!
 * @brief This function returns a reference to member altitude_minimum_delta_
 * @return Reference to member altitude_minimum_delta_
 */
float& collision_report::altitude_minimum_delta_()
{
    return m_altitude_minimum_delta_;
}

/*!
 * @brief This function sets a value in member horizontal_minimum_delta_
 * @param _horizontal_minimum_delta_ New value for member horizontal_minimum_delta_
 */
void collision_report::horizontal_minimum_delta_(float _horizontal_minimum_delta_)
{
m_horizontal_minimum_delta_ = _horizontal_minimum_delta_;
}

/*!
 * @brief This function returns the value of member horizontal_minimum_delta_
 * @return Value of member horizontal_minimum_delta_
 */
float collision_report::horizontal_minimum_delta_() const
{
    return m_horizontal_minimum_delta_;
}

/*!
 * @brief This function returns a reference to member horizontal_minimum_delta_
 * @return Reference to member horizontal_minimum_delta_
 */
float& collision_report::horizontal_minimum_delta_()
{
    return m_horizontal_minimum_delta_;
}


size_t collision_report::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;











    return current_align;
}

bool collision_report::isKeyDefined()
{
   return false;
}

void collision_report::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
}
